package net.hserver.admin.system.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import java.util.Set;

/**
 * 角色信息
 *
*
 * @since 2022-06-12
 */
@Getter
@Setter
@Table("tab_role")
public class Role {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id(value = "role_id", keyType = KeyType.Auto)
    private Long roleId;

    /**
     * 角色名称
     */
    private String roleName;

    /**
     * 显示顺序
     */
    private Integer roleSort;

    /**
     * 乐观锁
     */
    @Column(onUpdateValue = "version + 1")
    private Long version;

    /**
     * 逻辑删除
     */
    @Column(isLogicDelete = true)
    private Boolean deleted;

    /**
     * 创建时间
     */
    @Column( onInsertValue = "now()")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column(onUpdateValue = "now()", onInsertValue = "now()")
    private LocalDateTime updateTime;

    /**
     * 权限集合
     */
    @Column(ignore = true)
    private Set<String> permissions;

    /**
     * 权限ID集合
     */
    @Column(ignore = true)

    private Set<Long> menuIds;

}
